import java.util.ArrayList;

class Pistol extends Weapon
{
	public Pistol()
	{
		fireSpeed = 3.5;
		maxSpread = Math.PI/48;
		
		javax.swing.Timer t = new javax.swing.Timer(10,new WeaponControl());
		t.start();
	}
	
	public void fire(ArrayList<Entity> ents, double x, double y, double a)
	{
		if(fireTimer > 0)
			return;
		
		fireTimer = fireSpeed;
		
		double an = ((Math.random()>.5)?a+Math.random()*accuracy:a-Math.random()*accuracy);
		Bullet b = new Bullet(x+Math.cos(a)*17,y+Math.sin(a)*17,an,50);
		
		accuracy = Math.min(maxSpread,accuracy+.01);
		
		ents.add(b);
	}
	
	public void damage(int d){}
	public void collide(Entity e){}
	public void move(){}
	public void recalculateBoundingBox(){}
}